<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/7/20
  Time: 11:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="path" value="${pageContext.request.contextPath}"></c:set>
<html>
<head>
    <title>修改用户信息</title>
    <link rel="stylesheet" href="${path}/user/test02/css/register.css">
    <script src="${path}/user/test02/jquery-3.6.0.js"></script>
    <style>
        .tabbj2 {

            background-color: #E3EDFB;
            width: 900px;
            margin: 0 auto;
        }
        .reg_headline{
            background-image: url("/user/test02/img/memeber-toppic.jpg");
        }
        a {
            /*color: #555;*/
            color: white;
            text-decoration: none;
        }
        .updata_info{
            border:1px solid rgb(42,135,248);
            margin-left: 40px;
            background-color:rgb(58,197,254);
        }
    </style>
</head>
<body>
<jsp:include page="${path}/user/test03/normal/head.jsp"></jsp:include>

<table width="950" align="center" border="0" cellspacing="0" cellpadding="0" class="tabbj2">
    <tbody><tr><td>
        <form name="aspnetForm" method="post" action="${path}/UserServlet?mark=updateUser" id="aspnetForm">
            <table width="950" align="center" border="0" cellspacing="0" cellpadding="0" class="tabbj">
                <tbody><tr>
                    <td align="center" style="padding:5px;"><table width="100%" height="85" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #BBCADE">
                        <tbody><tr>
                            <td style="font-size:14px;">
                                <div class="reg_headline">
                                    <h2>修改用户信息</h2>
                                </div>

                                <div class="reg_boxes">
                                    <table width="75%" border="0" cellspacing="0" cellpadding="0" class="reg_tablelist">
                                        <tbody>
                                        <tr><td colspan="3"><span style="color: red;">${eorr}</span></td></tr>
                                        <tr>
                                            <td rowspan="5"><img src="${path}/user/test02/img/touxiang.jpg"></td>
                                            <td width="100" align="right" valign="top">用户名：&nbsp;&nbsp;</td>
                                            <td width="180" valign="top"><input type="text" id="userid" value="${user.userid}" name="userid"></td>

                                            <td align="left" valign="top"><span class="reg_info" id="chk_signup_username"></span></td>

                                        </tr>
                                        <tr>
                                            <td align="right" valign="top">登录密码：&nbsp;&nbsp;</td>
                                            <td valign="top" style="width: 170px;"><input type="text" id="pwd" value="${user.password}" name="pwd"></td>
                                            <td align="left" valign="top"><span class="reg_info" id="chk_signup_pwd"></span></td>

                                        </tr>
                                        <tr>
                                            <td align="right" valign="top">身份证：&nbsp;&nbsp;</td>
                                            <td valign="top"><input type="text" name="IDCar" value="${user.id}" readonly="true"></td>
                                            <td align="left" valign="top">
                                                <!-- <img width="100" height="22" align="absmiddle" alt="看不清楚请点击刷新" id="checkCode_img" src="/ValidateCode.aspx" onclick="javascript:getcheckcode(this);"> -->
                                                <span class="reg_info" id="checkCode_text"></span></td>

                                        </tr>
                                        <tr>
                                            <td align="right" valign="top">手机号码：&nbsp;&nbsp;</td>
                                            <td valign="top"><input type="text"id="phone" value="${user.phone}" name="phone"></td>
                                            <td align="left" valign="top"><span class="reg_info" id="chk_signup_mobilephone"></span></td>
                                        </tr>
                                        <tr>
                                            <td width="75" align="right">姓&nbsp;&nbsp;名：&nbsp;&nbsp;</td>
                                            <td width="184"><input type="text" value="${user.name}" id="name" name="name"></td>

                                            <td width="413"><span class="reg_info" id="chk_signup_name"></span></td>
                                        </tr>
                                        <tr>
                                            <td></td>
                                            <td width="75" align="right">性&nbsp;&nbsp;别：&nbsp;&nbsp;</td>
                                            <td width="184" align="left">
                                            <input name="sex" type="radio" value="男" ${user.sex=='男'?"checked":""}>男&nbsp;&nbsp;
                                                <input name="sex" type="radio" value="女" ${user.sex=='女'?"checked":""}>女
                                            </td>
                                            <td width="413">&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td></td>
                                            <td width="75" align="right">年&nbsp;&nbsp;龄：&nbsp;&nbsp;</td>
                                            <td width="184" align="left"><input type="number" value="${user.age}" name="age" id="age" min="1" max="150" style="width: 50px;">
                                            </td>
                                            <td width="413">&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td></td>
                                            <td align="right">家庭地址：&nbsp;&nbsp;</td>
                                            <td><input type="text" id="addr" value="${user.address}" name="addr"></td>
                                            <td><span class="reg_info" id="chk_signup_addr"></span></td>
                                        </tr>
                                        </tbody></table>
                                </div>
                                <div class="reg_btnbox">
                                    <!-- <input type="button" name="signup_submit" value="提交注册" onclick="this.style.display='none';$('loadid').style.display='';" id="signup_submit" class="base_btn07">&nbsp;<span id="loadid" style="display:none">请稍等....</span></div></td> -->
                                    <input type="button" name="signup_submit" value="确认修改"  id="signup_submit" class="base_btn07"></div></td>

                        </tr>
                        </tbody></table>
                    </td>
                </tr>
                </tbody></table>
        </form>
    </td></tr>
    </tbody>
</table>
<script>
    $(function () {
        $('#age').blur(function () {
           if($(this).val()<=0||$(this).val()>=150){
               alert('年龄请输入大于1且小于150的数字');
               $(this).val(${user.age});
           }
        });
        $('#signup_submit').click(function () {
            var str='';
            if($('#userid').val().length==0){
                str+='用户名，';
            }
            if($('#pwd').val().length==0){
                str+='密码，';
            }
            if($('#phone').val().length==0){
                str+='手机号码，';
            }if($('#name').val().length==0){
                str+='姓名，';
            }
            if($('#addr').val().length==0){
                str+='家庭住址，';
            }
            if (str.length>0){
                alert(str+'不能为空!');
                return;
            } else {

                $('#aspnetForm').submit();
                alert("个人信息修改成功！");
            }
        });
    });
</script>

<jsp:include page="${path}/user/test03/normal/footer.jsp"></jsp:include>

</body>
</html>
